package com.cashmama.market.api.application.controller.order.request;

import com.cashmama.market.api.domain.enums.OrderRecordEnum;
import com.cashmama.market.api.infras.exception.ApplicationException;
import com.fqgj.common.api.ParamsObject;

/**
 * @program: market-api
 * @description
 * @author: frank
 * @create: 2019-12-26 15:36
 **/
public class OrderRecordRequest extends ParamsObject {

    /**
     * 页码
     */
    private Integer currentPage;
    /**
     * 订单类型
     * @see OrderRecordEnum
     */
    private Integer type;

    public Integer getCurrentPage() {
        return currentPage;
    }

    public OrderRecordRequest setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
        return this;
    }

    public Integer getType() {
        return type;
    }

    public OrderRecordRequest setType(Integer type) {
        this.type = type;
        return this;
    }

    @Override
    public void validate() {
        if(currentPage == null){
            throw new ApplicationException("currentPage can not be empty");
        }
        if(type == null){
            throw new ApplicationException("type can not be empty");
        }
    }
}
